package bmark

class BookmarkService {

    static transactional = true

    def saveBookmark(Bookmark bookmarkInstance) {
        if (bookmarkInstance.save(flush:true)) {
            return true
        } 

        //let's try prepending a default http://
        bookmarkInstance.url = 'http://' + bookmarkInstance.url
        if (bookmarkInstance.save(flush:true)) {
            return true
        } 

        return false
    }
}
